package com.wc.codeforces.思维.Penchick_and_BBQ_Buns;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/11/15 21:04
 * @description
 * https://codeforces.com/contest/2031/problem/C
 */
public class Main {
    /**
     * 思路：n为偶数, 就 11 22 33 ... 就OK了<p>
     * n为奇数时候, 那就得找到一个数可以出现在 3个位置并且互相距离是 完全平方数<p>
     * 0 1 4 9 16 25, 可以发现0 9 25 或者是 0 16 25, 都可以满足条件<p>
     * 我们这个代码是用 1 10 26, 2到9之间有偶数个, 可以按照偶数的方式, 但是11 ~ 25之间有奇数个, 那么我们就看一下 27,<p>
     * 26不能用了, 那就只能考虑23满足 27 - 23 = 4, 找到了24 25正好是两个数, 11 ~ 22之间正好是偶数满足条件, 那么 n < 26的奇数是不够的<p>
     * 奇数 > 26 的可以整理序列为<p>
     * 1 2 2 3 3 4 4 5 5 1 6 6 7 7 8 8 9 9 10 10 11 11 12 13 13 1 12 14 14 15 15 ...满足条件<p>
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010;
    static int[] a = new int[N];
    static int n;

    public static void main(String[] args) {
        int T = sc.nextInt();
        while (T-- > 0){
            n = sc.nextInt();
            if ((n & 1) == 0){
                for (int i = 1, j = 1; i <= n; i += 2, j++) {
                    out.print(j + " " + j + " ");
                }
                out.println();
            } else {
                if (n < 26) out.println(-1);
                else {
                    out.print(1 + " ");
                    int j = 2;
                    for(int i = 2; i < 10; i += 2, j++){
                        out.print(j + " " + j + " ");
                    }
                    out.print(1 + " ");
                    for (int i = 11; i < 23; i += 2, j++){
                        out.print(j + " " + j + " ");
                    }
                    int num27 = j++;
                    out.print(num27 + " ");
                    out.print(j + " " + j + " ");
                    j++;
                    out.print(1 + " ");
                    out.print(num27 + " ");
                    for (int i = 28; i <= n; i += 2, j++){
                        out.print(j + " " + j + " ");
                    }
                }
            }
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

